module addr_gen_reg(
  input  [31:0] base,
  input  [31:0] offset,
  input  [ 4:0] sh_imm,
  input  [ 1:0] sh_op,
  input         cin,
  input         up,
  output [31:0] out
);

wire [31:0] offset_sh;

assign out = up ? base + offset_sh : base - offset_sh;

// verilator lint_off PINCONNECTEMPTY
shifter shifter(
  .op({sh_op,1'b0}),
  .in(offset),
  .cin(cin),
  .sh_imm(sh_imm),
  .sh_reg(),
  .out(offset_sh),
  .cout()
);
// verilator lint_on PINCONNECTEMPTY

endmodule
